<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
	<title>重庆宽仁妇孺照护管理有限公司实体店系统</title>
    <%@ include file="/common/include-core.jsp" %>
    <style>.error{color:red;}</style>
    <script type="text/javascript">
    <!--  
    if (top.location != location)  
    {  
    	top.location.href = location.href;  
    }  
    //-->  
     if (self != top) {    
    	 top.location.href=self.location.href;
  	 }  
    </script>
</head>
<body class="login_body">
<h2 align="center" class="login_title">宽仁妇孺照护管理有限公司实体店系统</h2>
<div class="login">
	<center>

	<div class="error">${error}</div>
	<form id='beanForm' action="${ctx}/auth/login" method="post" onsubmit="return validate_form(this)">
		<p><span>用户名：</span><input type="text" name="username" value="admin"></p>
		<p><span>密码：</span><input type="password" name="password" value="123456"></p>	     
	    <%-- jcaptchaEbabled 在JCaptchaValidateFilter设置 --%>
	    <p class="yzm_box">
	    	<span>验证码：</span>
	    	<input type="text" name="captcha" class="yzm">
	        <img class="jcaptcha-btn jcaptcha-img" style="cursor: pointer;" src="${ctx }/auth/jcaptcha.jpg" title="点击更换验证码">
	        <a class="jcaptcha-btn" href="javascript:;">换一张</a>
	    </p>	        
	 	<p>
	 		<span>实体店：</span>
	 		<select id="com" name="auth_store">
	        	<option value="">系统管理员</option>
	        </select>
	    </p>
	    <input type="submit" value="登录" class="sub_btn">
	</form>
	</center>	
</div>
<%@ include file="/common/include-footer.jsp" %>
 <script type="text/javascript">
	function validate_form(thisform)
	{
	   var username = $("#beanForm input[name='username']").val();
	   if(username==""){
	   alert("用户名不能为空！");
	   	return false;
	   }
	   var password = $("#beanForm input[name='password']").val();
	   if(password==""){
	   alert("密码不能为空！");
	   	return false;
	   }
	  var captcha = $("#beanForm input[name='captcha']").val();
	  if(captcha==""){
	   alert("验证码不能为空！");
	   	return false;
	   }
	  return true;
	}
	function init(){
		var action = getRootPath() + '/company/list.htm';
		var postData = {};
		$.post(action,postData,function(data){
				 var list = data.list;
				 if(list){
					 for(var i in list){
						 var obj = list[i];
						 $("#com").append('<option value="'+obj.num+'">'+obj.name+'</option>');
					 }
				 }
		});
	}
	    $(function() {
	    	init();
	        $(".jcaptcha-btn").click(function() {
	            $(".jcaptcha-img").attr("src", '${ctx }/auth/jcaptcha.jpg?'+new Date().getTime());
	        });
	    });
	</script>
</body>
</html>